import request from './request'

export const login = async (credentials) => {
  const { email, password } = credentials
  return request.post('/auth/login', { email, password })
}

export const register = async (userData) => {
  return request.post('/auth/register', userData)
}

export const logout = async () => {
  return request.post('/auth/logout')
}

export const fetchUser = async () => {
  return request.get('/users/me')
}